<?php
/**
 * Miffos framework
 * ----------------------------------------------
 *
 * Copyright (c) 2008, 2009 Martin Sadový (http://sodae.cz)
 *
 * This source file is subject to the "Miffos license" that is bundled
 * with this package in the file license.txt.
 *
 * @copyright  Copyright (c) 2008, 2009 Martin Sadový
 * @license    license.txt
 * @link       http://miffos.sodae.cz
 * @package    miffos
 * @version    $Id$
 */

class ApplicationException extends Exception{

    public function renderViewException()
    {
        list($what, $type, $name) = explode('-', $this->getMessage());
        $file = dirname(__FILE__).'/Exception/@'.$what.'-'.$type.'.phtml';
        if( file_exists($file) ){
            require_once $file;
        }else{
            throw $this;
        }
    }

}
/**
 * Code Exception:
 *  - 1 => missing constroller
 *  - 2 => missing action/method
 *  - 3 => missing view
 *  - 4 => missing model
 *  - 5 => missing layout
 *  - 6 => missing view service
 *  - 7 => missing view filter
 *  - 8 => missing control
 */
?>